<?
require_once('./lib/lib.gear.php');

$url = 'http://api.mixi-platform.com/2/messages/@me/@self/@outbox';

//$data = '{"title" : "Garden","body" : "招待しました。\nよろしく。\n http://reafo.net/garden/","recipients" : ["yee7djy9m7i6k"]}';

			$data = array(
			               'title'      => 'Garden',
			               'body'       => '招待しました。\nよろしく。\n http://reafo.net/garden/',
			               'recipients' => '["yee7djy9m7i6k"]',
			               );
			               

			$data = json_encode($data); 

$data = '{"title" : "Garden","body" : "招待しました。\nよろしく。\n http://reafo.net/garden/","recipients" : ["yee7djy9m7i6k"]}';
preDump($data);

$headers = array(
	"Host: api.mixi-platform.com",
    "Authorization: OAuth cbd25610c5ba23f46e41ab60b5d7618e34dde123",
	"Content-Length: ".strlen($data),
	"Content-Type: application/json; charset=UTF-8",

);

$options = array('http' => array(
    'method' => 'POST',
    'header' => implode("\r\n", $headers),
    'content' => $data,
));

$contents = file_get_contents($url, false, stream_context_create($options));

?>